package com.example.agricultural_big_data.controller;

import com.example.agricultural_big_data.service.MapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author xiao yang
 * @Description: 种植园地图
 * @date 2021/2/1415:01
 */
@RestController
@CrossOrigin
@RequestMapping("/map")
public class MapController {
    @Autowired
    MapService mapService;

    //获取所有的种植园的信息
//    @LoginRequired
    @GetMapping("/getPlantations")
    public Object getPlantations(){
        return mapService.getPlantations();
    }


    @GetMapping("/getPlant_avgs/{p_id}")
    public Object getPlant_avgsByid(@PathVariable("p_id") String p_id){
        return mapService.getPlant_avgsByid(p_id);
    }

}
